import React from 'react';
import {View, ScrollView, TouchableOpacity} from 'react-native';
import {Text, Button,ListItem} from '@rneui/base';
import {useNavigation} from '@react-navigation/native';
import {useMount} from 'ahooks';
import * as SvgIconHeaderRight from '../../SvgIconHeaderRight';
import {IconColor} from '../../config';
import HeaderPopoverMenu from '../../components/HeaderPopoverMenu';
import Dropdown from './Dropdown';
import D3 from './D3';
const rPPath = 'OPlayer';
export default ({pageName, setHeaderRight}) => {
  const navigation = useNavigation();

  const HeaderRight = () => {
    return (
      <>
        <HeaderPopoverMenu
          width={150}
          marginRight={10}
          menu={[
            {
              title: '名称',
              onPress: () => {},
            },
          ]}
        >
          <SvgIconHeaderRight.Sort
            color={IconColor}
            width={28}
            height={28}
            style={{marginRight: 10}}
          />
        </HeaderPopoverMenu>
        <HeaderPopoverMenu
          width={150}
          marginRight={10}
          menu={[
            {
              title: '设置',
              onPress: () => {},
            },
            {
              title: '主题',
              onPress: () => {},
            },
            {
              title: '购买',
              onPress: () => {},
            },
            {
              title: '反馈',
              onPress: () => {},
            },
          ]}
        >
          <SvgIconHeaderRight.More
            color={IconColor}
            width={28}
            height={28}
            style={{paddingLeft: 0, paddingRight: 0}}
          />
        </HeaderPopoverMenu>
      </>
    );
  };

  useMount(() => {
    setHeaderRight(<HeaderRight />);
  });
  return (
    <View style={{flex: 1}}>
      <ScrollView style={{flex: 1}}>
        <D3 />
      </ScrollView>
    </View>
  );
};
